Repository navigation
Conversation
Remove the legacy PING/PONG messages, handler, statistics and unused latency histogram because libp2p already manages connection liveness. Reject the retired message codes through the existing unknown-message path and remove unused MessageTypes range helpers. Preserve the remaining message codes, libp2p keepalive, discovery and backup heartbeats.
SeriousCoding789
left a comment
There was a problem hiding this comment.
I see it is only code cleanup. Please put it in next release.
There was a problem hiding this comment.
@SeriousCoding789 The previous fix addressed PING/PONG rate limiting only in libp2p, while the legacy application-layer PING/PONG handlers in java-tron remained. This PR removes those remaining handlers to complete the fix across both layers. I suggest including it in the current release so the issue is fully addressed.
waynercheung
left a comment
There was a problem hiding this comment.
Reviewed at 85b0e3c, LGTM. The removal is complete: no remaining references to the deleted classes, enum values, range helpers or metric key, and the 5 affected test classes pass locally (JDK 17 / aarch64, 40 tests). Liveness is unaffected: libp2p keepalive uses its own codes (0xff/0xfe).
Non-blocking suggestions:
- [SHOULD] Keep a comment in
MessageTypesthat 0x22/0x23 are retired and must not be reused: v4.7.2 - v4.8.2 still decode 0x22. - [NIT] A few minor items:
docs/metrics-changelog.mdstill liststron:ping_pong_latency_secondsin the baseline section; consider adding a "Removed Metrics" entry under 4.8.3.legacyKeepAliveIsRejectedAtP2pEntryWithoutReplyduplicatesMessageHandlerTest.testLegacyKeepAliveDisconnectsWithoutPong.- Raw
0x22/0x23literals in tests could be named constants.
xxo1shine
left a comment
There was a problem hiding this comment.
I suggest keeping the current scope of this PR. The other message codes are unchanged, and the retired codes have not been reused. The metrics documentation records the historical baseline. The two tests cover different aspects: rejection at the message entry point and the actual disconnect behavior. Using the legacy protocol byte values directly in the tests also makes them easy to verify. These suggestions do not affect the fix, so I suggest merging the current implementation.
What does this PR do?
Remove the legacy PING/PONG messages, handler, statistics and unused latency histogram because libp2p already manages connection liveness.
Reject the retired message codes through the existing unknown-message path and remove unused MessageTypes range helpers. Preserve the remaining message codes, libp2p keepalive, discovery and backup heartbeats.
Why are these changes required?
This PR has been tested by:
Follow up
Extra details